package com.lingchen.boot.gof.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.aop.framework.DefaultAopProxyFactory;
import org.springframework.stereotype.Component;

/**
 * Created by lc on 2020/6/23
 */
@Aspect()
@Component
public class Log {


    @Pointcut("execution(public * com.lingchen.boot.gof.aop.service..*.*(..))")
    public void log(){

    }

    @Before("log()")
    public void before(JoinPoint jp) {
        System.out.println("执行对象："+jp.getSignature().getName());
        System.out.println("执行前置通知");
    }
}
